package com.aeon.jface.treeTable.ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Shell;

public class TreeTableViewerDialog {

	private Shell mShell;

	public TreeTableViewerDialog(Shell parent) {

		mShell = new Shell(parent, SWT.DIALOG_TRIM |SWT.APPLICATION_MODAL|SWT.RESIZE);
		init();
//		
	}

	private void init() {
		mShell.setLayout(new FillLayout());
		TreeTableViewerComposit viewerComposit = new TreeTableViewerComposit(mShell,
				SWT.NONE);
	}

	
	public void open() {
//		mShell.setSize(mShell.computeSize(SWT.DEFAULT,SWT.DEFAULT,true));
		mShell.pack();
		mShell.open();
		while (!mShell.isDisposed()) {
			if (!mShell.getDisplay().readAndDispatch()) {
				mShell.getDisplay().sleep();
			}
		}

	}

}
